<template>
  <div id="app">
    <!-- 路由出口 -->
    <router-view></router-view> 
  </div>
</template>

<script>
export default {
  name: 'App'
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
<script setup>
import { onMounted } from 'vue';
import router from './router';

onMounted(() => {
  // 检查用户是否登录，如果未登录则跳转到登录页面
  const isLoggedIn = localStorage.getItem('isLoggedIn');
  if (!isLoggedIn) {
    router.push('/view/login.html');
  }
});
</script>

<style scoped>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>